<!DOCTYPE html>
<html lang="en">
<head>
    <!-- <meta charset="UTF-8"> -->
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
    <!-- <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> -->
    <meta http-equiv="refresh" content="30;url=http://baidu.com" charset="UTF-8">
    <!-- <meta http-equiv="X-UA-Compatible" content="ie=edge"> -->
    <title>Document</title>
</head>
<body>
    <button onclick="handleFullScreen()">点击</button>
</body>
<script>
    let exitFullscreen = false
    // 全屏事件
    function handleFullScreen() {
        let element = document.documentElement;
        console.log(this);
        if (this.fullscreen) {
            this.fullscreen = false
            document.exitFullscreen();
        } else {
            this.fullscreen = true;
            element.requestFullscreen();
        }
    }
</script>

</html>